package com.sam.im.heiqun.entities;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Joe on 2017/1/8.
 */

public class ReadyEntivity {

    private ImFriendEntivity myInfo;
    private List<ImFriendEntivity> friendsInfo;
    private List<ImGroupEntivity> groupsInfo;
    private List<TipEntity> topList;
    private String payInfo;

    public String getPayInfo() {
        return payInfo;
    }

    public void setPayInfo(String payInfo) {
        this.payInfo = payInfo;
    }


    public List<TipEntity> getTopList() {
        return topList;
    }

    public void setTopList(List<TipEntity> topList) {
        this.topList = topList;
    }

    public ImFriendEntivity getMyInfo() {
        return myInfo;
    }

    public void setMyInfo(ImFriendEntivity myInfo) {
        this.myInfo = myInfo;
    }

//    public List<ImFriendEntivity> getFriendsInfo() {
//        return friendsInfo;
//    }

    /**
     * 获取正常好友
     */
    public List<ImFriendEntivity> getWFriendsInfo() {
        List<ImFriendEntivity> friendsInfos = new ArrayList<>();
        if (null != friendsInfo && friendsInfo.size() > 0) {
            for (int i = 0; i < friendsInfo.size(); i++) {
                if (!"1".equals(friendsInfo.get(i).getIsBlack())) {
                    friendsInfos.add(friendsInfo.get(i));
                }
            }
        }
        return friendsInfos;
    }

    /**
     * 获取黑名单好友
     */
    public List<ImFriendEntivity> getBFriendsInfo() {
        List<ImFriendEntivity> friendsInfos = new ArrayList<>();
        if (null != friendsInfo && friendsInfo.size() > 0) {
            for (int i = 0; i < friendsInfo.size(); i++) {
                if ("1".equals(friendsInfo.get(i).getIsBlack())) {
                    friendsInfos.add(friendsInfo.get(i));
                }
            }
        }
        return friendsInfos;
    }

    /**
     * 获取全部好友
     */
    public List<ImFriendEntivity> getAllFriendsInfo() {
        return friendsInfo;
    }

    /**
     * 获取id好友
     */
    public ImFriendEntivity getIdFriendsInfo(Long id) {
        ImFriendEntivity idImFriendEntivity = null;
        if (null != friendsInfo && friendsInfo.size() > 0) {
            for (int i = 0; i < friendsInfo.size(); i++) {
                if ((id + "").equals(friendsInfo.get(i).getId() + "")) {
                    idImFriendEntivity = friendsInfo.get(i);
                    break;
                }
            }
        }
        return idImFriendEntivity;
    }

    /**
     * 获取id好友
     */
    public ImGroupEntivity getIdGroupsInfo(Long id) {
        ImGroupEntivity groupEntivity = null;
        if (null != groupsInfo && groupsInfo.size() > 0) {
            for (int i = 0; i < groupsInfo.size(); i++) {
                if ((id + "").equals(groupsInfo.get(i).getId() + "")) {
                    groupEntivity = groupsInfo.get(i);
                    break;
                }
            }
        }
        return groupEntivity;
    }

    public void setFriendsInfo(List<ImFriendEntivity> friendsInfo) {
        this.friendsInfo = friendsInfo;
    }

    public List<ImGroupEntivity> getGroupsInfo() {
        return groupsInfo;
    }

    public void setGroupsInfo(List<ImGroupEntivity> groupsInfo) {
        this.groupsInfo = groupsInfo;
    }
}
